package com.yaorange.nongjt.certificate.controller.wxapi;

import com.yaorange.nongjt.certificate.service.impl.CommonService;
import com.yaorange.nongjt.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author coach tam
 * @email 327395128@qq.com
 * @values 坚持灵活 灵活坚持
 * @since 2024/10/16
 */
@RestController
@RequestMapping("/api/common")
public class NjtCommonAPI {

    @Autowired
    private CommonService commonService;

    @GetMapping("/queryDictType")
    public AjaxResult queryDictType(@RequestParam("dictType") String dictType) {
        return AjaxResult.success(commonService.queryDictType(dictType));
    }

    @PostMapping("/upload")
    public AjaxResult upload(@RequestParam("file") MultipartFile file) {
        return AjaxResult.success(commonService.upload(file));
    }
}
